<template>
    <div class="home">
      <div class="search">
          <input type="text" placeholder="请输入商家、商品进行搜索">
      </div>
      <div class="banner">
          <img :src="pic" alt="">
      </div>
      <div class="change">
          <h3>猜你喜欢</h3>
          <div class="xuan">
              <div v-for="(item,index) in list" :key="index">{{item}}</div>
          </div>
      </div>
      <div class="stor" v-for="(item,index) in shoplist" :key="index">
          <div class="storImg">
              <img :src="item.picUrl" alt="">
          </div>
          <div class="shop">
              <h4>{{item.name}}</h4>
              <div class="datas">
                <div class="star">{{item.wmPoiScore/10}} {{item.monthSalesTip}}</div>
                <div class="fuwu">
                  <div >
                    <span>{{item.minPriceTip}}</span>
                    <span>{{item.shipplingFeeTip}}</span>
                  </div>
                  <div>
                    <span>{{item.deliveryTimeTip}}</span> 
                    <span> {{item.distance}}</span>
                  </div>
                </div>
              </div>
          </div>
      </div>
    </div>
  </template>
  
  <script>
  import {shop_list} from '../../utils/api';
  export default {
      data(){
        return{
          pic:'https://img1.baidu.com/it/u=3080736258,3021948994&fm=253&fmt=auto&app=138&f=JPEG?w=1920&h=470',
          list:['综合排序','销量领先','距离最近','筛选'],
          shoplist:[]
        }
      }, 
      mounted(){
      shop_list().then((res)=>{
        this.shoplist=res.data.list;
      })
    }
  }
  </script>
  
  <style  lang="scss" scoped>
  .home{
    height: 100%;
    margin-bottom: 60px;
  }
  .search{
    width: 100%;
    background-color: lightblue;
  }
  .search input{
    width: 80%;
    height: 36px;
    
    outline: none;
    border: none;
    border-radius: 18px;
    text-align: center;
    margin: 10px 0;
    margin-left: 10%;
  }
  .home .banner img{
    width: 94%;
    margin-left: 3%;
    padding-top: 10px;
  }
  .change .xuan{
    width: 100%;
    display: flex;
    margin: 10px 0;
    justify-content: space-around;
  }
  .home .stor{
    width: 100%;
    display: flex;
    justify-content: space-around;
  }
  .home .stor .storImg{
    width: 20%;
  }
  .home .stor .storImg img{
    width: 100%;
    height: 80%;
    padding-top: 20px;
  }
  .home .stor .shop{
    width: 70%;
    font-size: 14px;
    padding-bottom: 10px;
  }
  .home .stor .shop .fuwu{
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
  }
  </style>